package LogisticsSystem.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import LogisticsSystem.mapper.StaffMapper;
import LogisticsSystem.po.Staff;
import LogisticsSystem.po.StaffExample;
import LogisticsSystem.po.StaffExample.Criteria;
import LogisticsSystem.service.StaffService;
@Service
public class StaffServiceImpl implements StaffService {
	@Autowired
	private StaffMapper staffMapper;
	
	/**
	 * 根据id返回对应的职员
	 */
	@Override
	public Staff findStaff(Integer id) throws Exception {
		if (id != null) {
			return staffMapper.selectByPrimaryKey(id);
		}
		return null;
	}

	@Override
	public List<Staff> selectAllDispatchByRole2(String role) {
		StaffExample example = new StaffExample();
		Criteria criteria = example.createCriteria();
		criteria.andSRoleEqualTo(role);
		return staffMapper.selectByExample(example);
	}
	
	

}
